<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="HA集群," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="1 配置ha.cf&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;第一个是ha.cf该文件位于在安装后创建的/etc/ha.d目录中。该文件中包括为Heartbeat使用何种介质通路和如何配置他们的信息。在源代码目录中的ha.cf文件包含了您可以使用的全部选项，详述如下： serial /dev/ttyS0&amp;#160;&amp;#160;&amp;#160;&amp;#16">
<meta name="keywords" content="HA集群">
<meta property="og:type" content="article">
<meta property="og:title" content="heartbeat 部署过程">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/HA集群/2. heartbeat 配置文件详解/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="1 配置ha.cf&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;第一个是ha.cf该文件位于在安装后创建的/etc/ha.d目录中。该文件中包括为Heartbeat使用何种介质通路和如何配置他们的信息。在源代码目录中的ha.cf文件包含了您可以使用的全部选项，详述如下： serial /dev/ttyS0&amp;#160;&amp;#160;&amp;#160;&amp;#16">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-09-01T08:49:39.884Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="heartbeat 部署过程">
<meta name="twitter:description" content="1 配置ha.cf&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;第一个是ha.cf该文件位于在安装后创建的/etc/ha.d目录中。该文件中包括为Heartbeat使用何种介质通路和如何配置他们的信息。在源代码目录中的ha.cf文件包含了您可以使用的全部选项，详述如下： serial /dev/ttyS0&amp;#160;&amp;#160;&amp;#160;&amp;#16">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/HA集群/2. heartbeat 配置文件详解/"/>





  <title>heartbeat 部署过程 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/HA集群/2. heartbeat 配置文件详解/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">heartbeat 部署过程</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T02:04:46+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="1-配置ha-cf"><a href="#1-配置ha-cf" class="headerlink" title="1 配置ha.cf"></a>1 配置ha.cf</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;第一个是ha.cf该文件位于在安装后创建的/etc/ha.d目录中。该文件中包括为Heartbeat使用何种介质通路和如何配置他们的信息。在源代码目录中的ha.cf文件包含了您可以使用的全部选项，详述如下：</p>
<h3 id="serial-dev-ttyS0"><a href="#serial-dev-ttyS0" class="headerlink" title="serial /dev/ttyS0"></a>serial /dev/ttyS0</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;使用串口heartbeat－如果不使用串口heartbeat，则必须使用其他的介质，如bcast（以太网）heartbeat。用适当的设备文件代替/dev/ttyS0。</p>
<h3 id="watchdog-dev-watchdog"><a href="#watchdog-dev-watchdog" class="headerlink" title="watchdog /dev/watchdog"></a>watchdog /dev/watchdog</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;该选项是可选配置。通过Watchdog 功能可以获得提供最少功能的系统，该系统不提供heartbeat，可以在持续一份钟的不正常状态后重新启动。该功能有助于避免一台机器在被认定已经死亡之后恢复heartbeat的情况。如果这种情况发生并且磁盘挂载因故障而迁移（fail over），便有可能有两个节点同时挂载一块磁盘。如果要使用这项功能，则除了这行之外，也需要加载“softdog”内核模块，并创建相应的设备文件。方法是使用命令“insmod softdog”加载模块。然后输入“grep misc /proc/devices”并记住得到的数字（应该是10）。然后输入”cat /proc/misc | grep watchdog”并记住输出的数字（应该是130）。根据以上得到的信息可以创建设备文件，“mknod /dev/watchdog c 10 130”。</p>
<h3 id="bcast-eth1"><a href="#bcast-eth1" class="headerlink" title="bcast eth1"></a>bcast eth1</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;表示在eth1接口上使用广播heartbeat（将eth1替换为eth0，eth2，或者您使用的任何接口）。</p>
<h3 id="mcast-eth1-225-0-0-1-694-1-0"><a href="#mcast-eth1-225-0-0-1-694-1-0" class="headerlink" title="mcast eth1 225.0.0.1 694 1 0"></a>mcast eth1 225.0.0.1 694 1 0</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;如果采用组播通讯，在这里可以设置组播通讯所使用的接口，绑定的组播ip地址（在224.0.0.0-239.255.255.255之间），通讯端口，ttl(time to live)所能经过路由的跳数，是否允许回环（也就是本地发出的数据包是否还接收）。</p>
<h3 id="ucast-eth1-10-0-0-1"><a href="#ucast-eth1-10-0-0-1" class="headerlink" title="ucast eth1 10.0.0.1"></a>ucast eth1 10.0.0.1</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;如果采用单播，可以配置其网络接口及其所使用的ip地址。</p>
<h3 id="keepalive-2"><a href="#keepalive-2" class="headerlink" title="keepalive 2"></a>keepalive 2</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;设定heartbeat之间的时间间隔为2秒。</p>
<h3 id="warntime-10"><a href="#warntime-10" class="headerlink" title="warntime 10"></a>warntime 10</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在日志中发出“late heartbeat“警告之前等待的时间，单位为秒。</p>
<h3 id="deadtime-30"><a href="#deadtime-30" class="headerlink" title="deadtime 30"></a>deadtime 30</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在30秒后宣布节点死亡。</p>
<h3 id="initdead-120"><a href="#initdead-120" class="headerlink" title="initdead 120"></a>initdead 120</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在某些配置下，重启后网络需要一些时间才能正常工作。这个单独的”deadtime”选项可以处理这种情况。它的取值至少应该为通常deadtime的两倍。</p>
<h3 id="baud-19200"><a href="#baud-19200" class="headerlink" title="baud 19200"></a>baud 19200</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;波特率，串口通信的速度。</p>
<h3 id="udpport-694"><a href="#udpport-694" class="headerlink" title="udpport 694"></a>udpport 694</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;使用端口694进行bcast和ucast通信。这是默认的，并且在IANA官方注册的端口号。</p>
<h3 id="auto-failback-on"><a href="#auto-failback-on" class="headerlink" title="auto_failback on"></a>auto_failback on</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;该选项是必须配置的。对于那些熟悉Tru64 Unix的人来说，heartbeat的工作方式类似于“favored member“模式。在failover之前，haresources文件中列出的主节点掌握所有的资源，之后从节点接管这些资源。当auto_failback设置为on时，一旦主节点重新恢复联机，将从从节点取回所有资源。若该选项设置为off，主节点便不能重新获得资源。该选项与废弃的nice_failback选项类似。如果要从一个nice_failback设置为off的集群升级到这个或更新的版本，需要特别注意一些事项以防止flash cut。请参阅FAQ中关于如何处理这类情况的章节。</p>
<h3 id="node-primary-mydomain-com"><a href="#node-primary-mydomain-com" class="headerlink" title="node primary.mydomain.com"></a>node primary.mydomain.com</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;该选项是必须配置的。集群中机器的主机名，与“uname –n”的输出相同。</p>
<h3 id="node-backup-mydomain-com"><a href="#node-backup-mydomain-com" class="headerlink" title="node backup.mydomain.com"></a>node backup.mydomain.com</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;该选项是必须配置的。同上。</p>
<h3 id="respawn"><a href="#respawn" class="headerlink" title="respawn"></a>respawn</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;该选项是可选配置的：列出将要执行和监控的命令。例如：要执行ccm守护进程，则要添加如下的内容：</p>
<h3 id="respawn-hacluster-usr-lib-heartbeat-ccm"><a href="#respawn-hacluster-usr-lib-heartbeat-ccm" class="headerlink" title="respawn hacluster /usr/lib/heartbeat/ccm"></a>respawn hacluster /usr/lib/heartbeat/ccm</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;使得Heartbeat以userid（在本例中为hacluster）的身份来执行该进程并监视该进程的执行情况，如果其死亡便重启之。对于ipfail，则应该是：</p>
<h3 id="respawn-hacluster-usr-lib-heartbeat-ipfail"><a href="#respawn-hacluster-usr-lib-heartbeat-ipfail" class="headerlink" title="respawn hacluster /usr/lib/heartbeat/ipfail"></a>respawn hacluster /usr/lib/heartbeat/ipfail</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;对于pingd则应该是：</p>
<h3 id="respawn-hacluster-usr-lib64-heartbeat-pingd-m-100-d-5s"><a href="#respawn-hacluster-usr-lib64-heartbeat-pingd-m-100-d-5s" class="headerlink" title="respawn hacluster /usr/lib64/heartbeat/pingd -m 100 -d 5s"></a>respawn hacluster /usr/lib64/heartbeat/pingd -m 100 -d 5s</h3><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;注意：如果结束进程的退出代码为100，则不会重启该进程。</p>
<h3 id="apiauth-pingd-gid-haclient-uid-hacluster"><a href="#apiauth-pingd-gid-haclient-uid-hacluster" class="headerlink" title="apiauth pingd gid=haclient uid=hacluster"></a>apiauth pingd gid=haclient uid=hacluster</h3><h2 id="2-配置haresources"><a href="#2-配置haresources" class="headerlink" title="2 配置haresources"></a>2 配置haresources</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;配置好ha.cf文件之后，便是haresources文件。该文件列出集群所提供的服务以及服务的默认所有者。 注意：两个集群节点上的该文件必须相同。集群的IP地址是该选项是必须配置的，不能在haresources文件以外配置该地址, haresources文件用于指定双机系统的主节点、集群IP、子网掩码、广播地址以及启动的服务等。其配置语句格式如下：</p>
<p>node-name network-config</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;其中node-name指定双机系统的主节点，取值必须匹配ha.cf文件中node选项设置的主机名中的一个，node选项设置的另一个主机名成为从节点。network-config用于网络设置，包括指定集群IP、子网掩码、广播地址等。resource-group用于设置heartbeat启动的服务，该服务最终由双机系统通过集群IP对外提供。在本文中我们假设要配置的HA服务为Apache和Samba。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在haresources文件中需要如下内容：</p>
<p>primary.mydomain.com 192.168.85.3 httpd smb</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;该行指定在启动时，节点linuxha1得到IP地址192.168.85.3，并启动Apache和Samba。在停止时，Heartbeat将首先停止smb，然后停止Apache，最后释放IP地址192.168.85.3。这里假设命令“uname –n”的输出为“primary.mydomain.com”－如果输出为“primary”，便应使用“primary”。</p>
<p>primary.mydomain.com IPaddr::192.168.21.107/24/eth0 drbddisk::r0 Filesystem::/dev/drbd1::/data::ext4 nfs</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;正确配置好haresources文件之后，将ha.cf和haresource拷贝到/etc/ha.d目录。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;注意：资源文件中能执行的命令必须在/etc/ha.d/resource.d/ 中可见</p>
<h2 id="3-配置Authkeys"><a href="#3-配置Authkeys" class="headerlink" title="3 配置Authkeys"></a>3 配置Authkeys</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;需要配置的第三个文件authkeys决定了您的认证密钥。共有三种认证方式：crc，md5，和sha1。您可能会问：“我应该用哪个方法呢？”简而言之： 如果您的Heartbeat运行于安全网络之上，如本例中的交叉线，可以使用crc，从资源的角度来看，这是代价最低的方法。如果网络并不安全，但您也希望降低CPU使用，则使用md5。最后，如果您想得到最好的认证，而不考虑CPU使用情况，则使用sha1，它在三者之中最难破解。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;文件格式如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">auth []</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;因此，对于sha1，示例的/etc/ha.d/authkeys可能是</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">auth 1</div><div class="line">1 sha1 key-for-sha1-any-text-you-want</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;对于md5，只要将上面内容中的sha1换成md5就可以了。 对于crc，可作如下配置：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">auth 2</div><div class="line">2 crc</div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;不论您在关键字auth后面指定的是什么索引值，在后面必须要作为键值再次出现。如果您指定“auth 4”，则在后面一定要有一行的内容为“4 ”。</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;确保该文件的访问权限是安全的，如600。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/HA集群/" rel="tag"># HA集群</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/HA集群/1. HA 集群配置/" rel="next" title="HA 集群配置">
                <i class="fa fa-chevron-left"></i> HA 集群配置
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/HA集群/3. heartbeat和keepalived的区别/" rel="prev" title="heartbeat和keepalived的区别">
                heartbeat和keepalived的区别 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-配置ha-cf"><span class="nav-number">1.</span> <span class="nav-text">1 配置ha.cf</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#serial-dev-ttyS0"><span class="nav-number">1.1.</span> <span class="nav-text">serial /dev/ttyS0</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#watchdog-dev-watchdog"><span class="nav-number">1.2.</span> <span class="nav-text">watchdog /dev/watchdog</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#bcast-eth1"><span class="nav-number">1.3.</span> <span class="nav-text">bcast eth1</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#mcast-eth1-225-0-0-1-694-1-0"><span class="nav-number">1.4.</span> <span class="nav-text">mcast eth1 225.0.0.1 694 1 0</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ucast-eth1-10-0-0-1"><span class="nav-number">1.5.</span> <span class="nav-text">ucast eth1 10.0.0.1</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#keepalive-2"><span class="nav-number">1.6.</span> <span class="nav-text">keepalive 2</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#warntime-10"><span class="nav-number">1.7.</span> <span class="nav-text">warntime 10</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#deadtime-30"><span class="nav-number">1.8.</span> <span class="nav-text">deadtime 30</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#initdead-120"><span class="nav-number">1.9.</span> <span class="nav-text">initdead 120</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#baud-19200"><span class="nav-number">1.10.</span> <span class="nav-text">baud 19200</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#udpport-694"><span class="nav-number">1.11.</span> <span class="nav-text">udpport 694</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#auto-failback-on"><span class="nav-number">1.12.</span> <span class="nav-text">auto_failback on</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#node-primary-mydomain-com"><span class="nav-number">1.13.</span> <span class="nav-text">node primary.mydomain.com</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#node-backup-mydomain-com"><span class="nav-number">1.14.</span> <span class="nav-text">node backup.mydomain.com</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#respawn"><span class="nav-number">1.15.</span> <span class="nav-text">respawn</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#respawn-hacluster-usr-lib-heartbeat-ccm"><span class="nav-number">1.16.</span> <span class="nav-text">respawn hacluster /usr/lib/heartbeat/ccm</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#respawn-hacluster-usr-lib-heartbeat-ipfail"><span class="nav-number">1.17.</span> <span class="nav-text">respawn hacluster /usr/lib/heartbeat/ipfail</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#respawn-hacluster-usr-lib64-heartbeat-pingd-m-100-d-5s"><span class="nav-number">1.18.</span> <span class="nav-text">respawn hacluster /usr/lib64/heartbeat/pingd -m 100 -d 5s</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#apiauth-pingd-gid-haclient-uid-hacluster"><span class="nav-number">1.19.</span> <span class="nav-text">apiauth pingd gid=haclient uid=hacluster</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-配置haresources"><span class="nav-number">2.</span> <span class="nav-text">2 配置haresources</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-配置Authkeys"><span class="nav-number">3.</span> <span class="nav-text">3 配置Authkeys</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
